package gang.org.springframework.framework.support;

import gang.org.springframework.framework.bean.GangBeanDefinition;

/**
 * @author ChenGang
 */
public interface GangBeanDefinitionRegistry extends GangAliasRegistry {

    /**
     * Register a new bean definition with this registry.
     * Must support RootBeanDefinition and ChildBeanDefinition.
     * @param beanName the name of the bean instance to register
     * @param beanDefinition definition of the bean instance to register
     * @throws Exception if the BeanDefinition is invalid
     * @throws Exception if there is already a BeanDefinition
     * for the specified bean name and we are not allowed to override it
     * @see gang.org.springframework.framework.bean.GangRootBeanDefinition
     */
    void registerBeanDefinition(String beanName, GangBeanDefinition beanDefinition);

    String[] getBeanDefinitionNames();

    boolean containsBeanDefinition(String beanName);

    GangBeanDefinition getBeanDefinition(String beanName);
}
